<%@page import="com.crm.entity.Parts,com.crm.entity.Sources,com.crm.entity.Clientdet,java.util.*" %>
<title>ASCRM</title>
<%
	List<Parts> partslist =(List<Parts>)request.getAttribute("parts");
	List<Sources> sourcelist =(List<Sources>)request.getAttribute("sources");
	System.out.println("Parts List Is:"+partslist);
	System.out.println("Sources X000 List Is:"+sourcelist);
%>
<table width="100%" border="0" cellpadding="4" cellspacing="1" bgcolor="#C5E4EB">
          <tr>
            <td width="27" height="30" align="left" valign="middle" background="<%=application.getContextPath()%>/images/table-box.jpg"  style="background-repeat:repeat-x">S.No</td>
            <td width="242" align="left" valign="middle" background="<%=application.getContextPath()%>/images/table-box.jpg"   style="background-repeat:repeat-x" bgcolor="#FFFFFF"> Part Number </td>
            <td width="242" align="left" valign="middle" background="<%=application.getContextPath()%>/images/table-box.jpg"   style="background-repeat:repeat-x" bgcolor="#FFFFFF"> Description </td>
              <%for(int j=0;j<sourcelist.size();j++){%>
              <td width="216" align="left" valign="middle" background="<%=application.getContextPath()%>/images/table-box.jpg"   style="background-repeat:repeat-x" bgcolor="#FFFFFF">
              <input class="col<%=j%> case" onclick='checkSources(this,"col<%=j%>")' type="checkbox" value="<%=sourcelist.get(j).getSourceName() %>" id="<%=sourcelist.get(j).getSourceName() %>" checked="checked"/><%=sourcelist.get(j).getSourceName() %></td>
              <%} %>
          </tr>
           <%  if(partslist!=null){
        	   for(int i=0;i<partslist.size();i++){  %>
          <tr>
            <td bgcolor="#FFFFFF">
            <input name="sno" type="text" value="<%=i+1 %>" size="5" />
            </td>
            <td align="left" valign="top" bgcolor="#FFFFFF">
            <input name="part<%=i+1%>" type="text" value="<%=partslist.get(i).getPrtnum() %>"  size="5"/><input name="partid<%=i+1%>" type="hidden" value="<%=partslist.get(i).getPartid() %>"  size="5"/></td>
            <td align="left" valign="top" bgcolor="#FFFFFF">
            <input name="desc<%=i+1%>" type="text" value="<%=partslist.get(i).getDescription()%>"  size="5"/></td>
             <%for(int j=0;j<sourcelist.size();j++){%>
            <td align="left" valign="top" bgcolor="#FFFFFF"><input class="col<%=j%> case" type="checkbox" value="<%=sourcelist.get(j).getSourceName()%><%=i+1%>" id="<%=sourcelist.get(j).getSourceName()%><%=i+1%>" name="<%=sourcelist.get(j).getSourceName()%><%=i+1%>" checked="checked"/>
            <%}%>
          </tr>
          <%} }%>
        </table>